<template>
  <div class="w_fill">
    <div class="flexBox" v-for="(item, index) in value" :key="index">
      <ex_super_input v-model="item.logisticsSupplier" @changeItem="e => changeItem(e, index)" :placeholder="$tt('label_purchase_selective_logistics')" type="select" enum="PurchaseOrderLogisticsEnum"></ex_super_input>
      <div>
        <ex_super_input v-model="item.trackingNumber" @input="e => inputFunc(e, index)" :placeholder="$tt('label_purchase_enter_tracking_number')" type="input"></ex_super_input>
        <i class="el-icon-plus" v-if="index === 0" @click="add"></i>
        <i class="el-icon-minus" v-else @click="minus(index)"></i>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  components:{
    
  },
  props:{
    value: {
      type: Array,
      default: () => []
    }
    
  },
  data () {
    return {
    }
  },
  watch: {
  },
  computed: {
    
  },
  created () {
    
  },
  mounted () {
  },
  methods: {
    add() {
      this.$emit('add' )
    },
    minus(index) {
      this.$emit('minus', index )
    },
    changeItem(e, index) {
      this.$emit('changeItem', e )
    },
    inputFunc(e, index) {
      this.$emit('inputFunc', e )

    }
  },
  destroyed () {
    
  }
};
</script>

<style lang="less" scoped>
.flexBox {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 5px;
  &:last-child {
    margin-bottom: 0;
  }
  > div {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 5px;
    &:last-child {
      margin-right: 0;
    }
    > i {
      width: 30px;
      cursor: pointer;
    }
  }
}
</style>